package com.team.employment.web.admin.custom.check;

import com.baomidou.mybatisplus.extension.service.IService;
import com.team.employment.common.exception.CustomException;
import com.team.employment.common.result.ResultCodeEnum;
import org.springframework.stereotype.Component;

@Component
public class IdIsEmptyCheck<T> {

    public void idIsEmpty(IService<T> service, Long id) {
        T obj = service.getById(id);
        if (obj == null) {
            throw new CustomException(ResultCodeEnum.PARAM_ERROR);
        }
    }
}
